
package com.zsrt.day20170506.socket;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

/**
 * 192.168.3.153
 * @author jmj
 * @date 2017年5月6日
 * @time 下午5:19:41
 */
public class UDPSend {

	public static void main(String[] args) throws Exception {
		DatagramSocket ds = new DatagramSocket(1233);
		
		String string = "hello..beautifulbutterfly.";
		
		byte[] bs = string.getBytes();
		
		InetAddress ip = InetAddress.getByName("127.0.0.1");
		DatagramPacket dp = new DatagramPacket(bs,bs.length,ip,4321);
		
		ds.send(dp);
	}
}
